package com.shudes.game;

import java.util.*;

import com.shudes.pt.pojo.*;

public class HoldemGame {

	protected Deck deck;
	protected Board board; 
	protected Map<Seat, HoleCards> holeCards;
	protected Seat  heroSeat; 
	protected Seat button;
	protected Integer numberOfPlayers; 
	
	public HoldemGame(Integer totalPlayers) {
		deck = new Deck(); 
		numberOfPlayers = totalPlayers; 
		holeCards = new HashMap<Seat, HoleCards>();
		for(int i=0;i<totalPlayers;i++) { 
			holeCards.put(new Seat(i+1),null); 
		}
	}
	
	public HoldemGame(Integer totalPlayers, Seat heroSeat, HoleCards heroHand) {
		this(totalPlayers); 
		this.heroSeat=heroSeat; 
		holeCards.put(heroSeat, heroHand); 
	}

	public Deck getDeck() { 
		return this.deck; 
	}
	
	public Board getBoard() {
		return board;
	}

	public void setBoard(Board board) {
		this.board = board;
	}

	public void addHoleCards(Seat seat, HoleCards hc) {
		if(holeCards.containsKey(seat))
			holeCards.put(seat, hc); 
	}

	public HoleCards getHeroHoleCards() {
		return (heroSeat==null) ? null : holeCards.get(heroSeat); 
	}
	
	public void setButton(Seat button) {
		this.button=button;
	}
	
	public Seat getButton() { 
		return button; 
	}

	public Integer getNumberOfPlayers() { 
		return this.numberOfPlayers;
	}
	
	
}
